#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H

#include <QGraphicsView>
#include <QtGui>

class GraphicsView : public QGraphicsView {
	Q_OBJECT
public:
	/* functions */
	explicit GraphicsView(QWidget *parent = 0);
	virtual void mouseReleaseEvent (QMouseEvent *event);
    int getCurrentRectNum() { return currentRectNum; }
    QList<QPoint> getPointsList() { return rectsPoints; }
    void setMaxRectsNum(int n) { maxRectsNum = n; }
    void setMouseEnabled(bool opt) { mouseEnabled = opt; }

public slots:
	void resetRects();

private:
	/* data */
	QPoint point1;
	QPoint point2;
	QList<QPoint> rectsPoints;
	QList<QGraphicsRectItem *> rects;
	int currentRectNum;
	int maxRectsNum;
	bool mouseEnabled;
};

#endif // GRAPHICSVIEW_H
